import request from '@/utils/request'

export function getList(data) { // 获取托盘类型列表
  return request({
    url: '/PB/PB_TrayType/GetDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 10,
      Search: {
        keyword: data
      }
    }
  })
}
export function addlist(data) { // 新增托盘
  return request({
    url: '/PB/PB_TrayType/SaveData',
    method: 'post',
    data
  })
}
export function deletelist(data) { // 删除托盘
  return request({
    url: '/PB/PB_TrayType/DeleteData',
    method: 'post',
    data
  })
}

export function getTPxiangxi(data) { // 获取被编辑托盘详细
  return request({
    url: '/PB/PB_TrayType/GetTheData',
    method: 'post',
    data
  })
}
export function updatelist(data) { // 获取分区管理
  return request({
    url: `/PB/PB_TrayZone/GetDataListByType?typeId=${data}`,
    method: 'post'
  })
}
export function addFenQv(data) { // 获取托盘类型
  return request({
    url: '/PB/PB_TrayZone/SaveData',
    method: 'post',
    data
  })
}

export function deletelistFenQ(data) { // 删除分区
  return request({
    url: '/PB/PB_TrayZone/DeleteData',
    method: 'post',
    data
  })
}

export function getFenQxiangxi(data) { // 获取分区详细
  return request({
    url: '/PB/PB_TrayZone/GetTheData',
    method: 'post',
    data
  })
}
export function getWuLiaoGuanLian(data) { // 获取关联物料列表
  return request({
    url: '/PB/PB_TrayMaterial/GetDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 10,
      Search: {
        keyword: data
      },
      SortField: 'MaterialId',
      SortType: 'asc'
    }
  })
}

export function getWuLiaoXuanZe() { // 关联物料里面的添加下的表格数据
  return request({
    url: 'PB/PB_Material/QueryDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 100,
      Search: {
      },
      SortField: 'Id',
      SortType: 'asc'
    }
  })
}

export function getWuLiaoXuanZe2() { // 关联物料里面的添加下的表格数据
  return request({
    url: 'PB/PB_MaterialType/GetTreeDataList',
    method: 'post'
  })
}

export function getChaXun_WLGL(data) { // 新建关联物料下的搜索
  return request({
    url: '/PB/PB_Material/QueryDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 100,
      Search: {
        TypeId: data.TypeId,
        Keyword: data.Keyword,
        ContactName: data.ContactName
      },
      SortField: 'Id',
      SortType: 'asc'
    }
  })
}
export function addWLGLlist(data) {
  return request({
    url: '/PB/PB_TrayMaterial/SaveDatas',
    method: 'post',
    data: {
      id: data.id,
      keys: data.keys
    }
  })
}
export function deleteGLWLlist(data) { // 删除关联物料
  return request({
    url: `/PB/PB_TrayMaterial/DeleteData?trayTypeId=${data.id}`,
    method: 'post',
    data: data.XZ_id
  })
}
export function getGLHWlist(data) { // 关联物料的表格数据
  return request({
    url: '/PB/PB_LocalTray/GetDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 100,
      Search: {
      },
      SortField: 'LocalId',
      SortType: 'asc'
    }
  })
}

export function getaddGLHWlist(data) { // 关联货位的添加表格数据
  return request({
    url: '/PB/PB_Location/GetDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 100,
      Search: {
      },
      SortField: 'Id',
      SortType: 'asc'
    }
  })
}

export function addGLHWlist() { // 关联货位的添加表格数据
  return request({
    url: '/PB/PB_Storage/QueryStorageData',
    method: 'post'
  })
}

export function GLHW_chaxun(data) {
  return request({
    url: '/PB/PB_Location/GetDataList',
    method: 'post',
    data: {
      PageIndex: 1,
      PageRows: 100,
      Search: {
        StorId: data.TypeId,
        Keyword: data.Keyword,
        AreaName: data.AreaName
      },
      SortField: 'Id',
      SortType: 'asc'
    }
  })
}
export function addGLHWlist2(data) {
  return request({
    url: '/PB/PB_LocalTray/SaveDatas',
    method: 'post',
    data: {
      id: data.id,
      keys: data.keys
    }
  })
}
